'''字符串格式化表达'''
print("%10d" % 123) #       123
print("%-10d" % 123)#123
print("%10s" % "abc")#       abc
print("%-5s" % "abc")#abc
print("%05d" % 123)#00123

print("%2.3f" % 3.1415926)#  3.142
#本质上就是从后面的变量中取出一个变量，吧格式化字符串替换掉
print("%(name)s and %(age)d" % {"name":"郭德纲","age":30})

x=3.1415926
print("%-6.2f and %+3.4f and %06.9f and % 6.2f" % (x,x,x,x))
print("%s and %*.*f" % ("abc",3,5,3.1415926))
print("%s and %*.*f" % ("abc",5,6,3.1415926))